package net.zabuchy.project.dao;
 
import java.util.List;
import java.util.Set;
 
import net.zabuchy.project.entity.Project;
import net.zabuchy.user.entity.User;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
 
public class ProjectDaoImpl extends HibernateDaoSupport implements ProjectDao {
 
    public void add(Project project) {
        getHibernateTemplate().save(project);
    }
 
    public void delete(Project project) {
        getHibernateTemplate().delete(project);
    }
    
    public void addUsers(Project project, List<User> users) {
    	
    	for(User user : users) {
    		
    	}
    }
 
    public List findAll() {
        return getHibernateTemplate().find("from Project");
    }
 
    public Project findById(int id) {
        return (Project) getHibernateTemplate().find("from Project where PROJECT_ID=?", id).get(0);
    }
 
    public Project findByTitle(String title) {
        return (Project) getHibernateTemplate().find("from Project where title=?", title).get(0);
    }
 
    public void update(Project project) {
        getHibernateTemplate().update(project);
    }

	
}